package entity

import (
	"shqsoft.cn/pasnj/base"
)

//经济资本
type CompClieQylxWh struct {
	ID          int    `gorm:"AUTO_INCREMENT;primary_key;column:ID"`
	JLID        int    `gorm:"column:JLID"` //数仓对公客户自增ID
	QYLX        int    `gorm:"column:QYLX"` //企业类型行标
	QYLXCaption string `gorm:"-"`
	GJLX        int    `gorm:"column:GJLX"` //企业类型国标
	GJLXCaption string `gorm:"-"`
}

//TableName 客户企业类型维护
func (CompClieQylxWh) TableName() string {
	return "T_COMP_CLIE_QYLX_WH"
}

// AfterFind
func (u *CompClieQylxWh) AfterFind() (err error) {
	if u.QYLX == 2 {
		u.QYLXCaption = "中型"
	} else if u.QYLX == 3 {
		u.QYLXCaption = "小型"
	} else if u.QYLX == 4 {
		u.QYLXCaption = "微型"
	} else {
		u.QYLXCaption = "非中小"
	}
	if u.GJLX == 2 {
		u.GJLXCaption = "中型"
	} else if u.GJLX == 3 {
		u.GJLXCaption = "小型"
	} else if u.GJLX == 4 {
		u.GJLXCaption = "微型"
	} else {
		u.GJLXCaption = "大型"
	}
	return
}

func CompClieQylxWhEF() base.EntityFunc {
	return func() interface{} {
		entity := CompClieQylxWh{}
		return &entity
	}
}
func CompClieQylxWhESF() base.EntitiesFunc {
	return func() interface{} {
		var entities []CompClieQylxWh
		return &entities
	}
}

func init() {
	base.DaoPoolObj.Put("CompClieQylxWh", base.NewDefaultDao(CompClieQylxWhEF(), CompClieQylxWhESF(), nil))
}
